/*
 * Thermistor.hpp
 *
 * Copyright 2012 Pieter Agten
 *
 * This file is part of tltgen.
 *
 * tltgen is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * tltgen is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with tltgen.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @file   Thermistor.hpp
 * @author Pieter Agten (pieter.agten@gmail.com)
 * @date   20 feb 2012
 * @brief  The abstract Thermistor class defines the interface concrete 
 *         thermistor models must adhere to.
 */

#ifndef THERMISTOR_HPP
#define THERMISTOR_HPP

#include <boost/shared_ptr.hpp>

#include "Temperature.hpp"
#include "Resistance.hpp"

#include <iostream>

using boost::shared_ptr;

namespace tltgen {

  class ThermistorModel;
  class ThermistorVisitor;
  class Thermistor {
  public:
    Thermistor();
    virtual ~Thermistor();

    virtual bool isValidResistance(Resistance resistance) const = 0;
    virtual Temperature getTemperature(Resistance resistance) const = 0;

    virtual bool isValidTemperature(Temperature temperature) const = 0;
    virtual Resistance getResistance(Temperature temperature) const = 0;

    virtual bool isValidParameterIndex(unsigned int pi) const = 0;
    virtual double getParameterValue(unsigned int pi) const = 0;

    virtual void accept(ThermistorVisitor* visitor) const = 0;

    virtual std::ostream &print(std::ostream &stream) const = 0;

  };

}

inline std::ostream& operator <<(std::ostream& stream, const tltgen::Thermistor& thermistor) {
  return thermistor.print(stream);
}

#endif
